package edu.unf.cen6940.domain;

import java.io.Serializable;

import java.lang.StringBuilder;

import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;

import javax.xml.bind.annotation.*;

import javax.persistence.*;

/**
 */

@Entity
@NamedQueries({
		@NamedQuery(name = "findAllUserlogins", query = "select myUserlogin from Userlogin myUserlogin"),
		@NamedQuery(name = "findUserloginByPasswordHash", query = "select myUserlogin from Userlogin myUserlogin where myUserlogin.passwordHash = ?1"),
		@NamedQuery(name = "findUserloginByPasswordHashContaining", query = "select myUserlogin from Userlogin myUserlogin where myUserlogin.passwordHash like ?1"),
		@NamedQuery(name = "findUserloginByPrimaryKey", query = "select myUserlogin from Userlogin myUserlogin where myUserlogin.userLoginId = ?1"),
		@NamedQuery(name = "findUserloginByUserLoginId", query = "select myUserlogin from Userlogin myUserlogin where myUserlogin.userLoginId = ?1"),
		@NamedQuery(name = "findUserloginByUserName", query = "select myUserlogin from Userlogin myUserlogin where myUserlogin.userName = ?1"),
		@NamedQuery(name = "findUserloginByUserNameContaining", query = "select myUserlogin from Userlogin myUserlogin where myUserlogin.userName like ?1") })
@Table(catalog = "ThesisManagement", name = "UserLogin")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(namespace = "rms_test/edu/unf/cen6940/domain", name = "Userlogin")
public class Userlogin implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 */

	@Column(name = "userLoginID", nullable = false)
	@Basic(fetch = FetchType.EAGER)
	@Id
	@XmlElement
	Integer userLoginId;
	/**
	 */

	@Column(name = "userName", length = 50, nullable = false)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String userName;
	/**
	 */

	@Column(name = "passwordHash", length = 50, nullable = false)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String passwordHash;

	/**
	 */
	public void setUserLoginId(Integer userLoginId) {
		this.userLoginId = userLoginId;
	}

	/**
	 */
	public Integer getUserLoginId() {
		return this.userLoginId;
	}

	/**
	 */
	public void setUserName(String userName) {
		this.userName = userName;
	}

	/**
	 */
	public String getUserName() {
		return this.userName;
	}

	/**
	 */
	public void setPasswordHash(String passwordHash) {
		this.passwordHash = passwordHash;
	}

	/**
	 */
	public String getPasswordHash() {
		return this.passwordHash;
	}

	/**
	 */
	public Userlogin() {
	}

	/**
	 * Copies the contents of the specified bean into this bean.
	 *
	 */
	public void copy(Userlogin that) {
		setUserLoginId(that.getUserLoginId());
		setUserName(that.getUserName());
		setPasswordHash(that.getPasswordHash());
	}

	/**
	 * Returns a textual representation of a bean.
	 *
	 */
	public String toString() {

		StringBuilder buffer = new StringBuilder();

		buffer.append("userLoginId=[").append(userLoginId).append("] ");
		buffer.append("userName=[").append(userName).append("] ");
		buffer.append("passwordHash=[").append(passwordHash).append("] ");

		return buffer.toString();
	}

	/**
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = (int) (prime * result + ((userLoginId == null) ? 0 : userLoginId.hashCode()));
		return result;
	}

	/**
	 */
	public boolean equals(Object obj) {
		if (obj == this)
			return true;
		if (!(obj instanceof Userlogin))
			return false;
		Userlogin equalCheck = (Userlogin) obj;
		if ((userLoginId == null && equalCheck.userLoginId != null) || (userLoginId != null && equalCheck.userLoginId == null))
			return false;
		if (userLoginId != null && !userLoginId.equals(equalCheck.userLoginId))
			return false;
		return true;
	}
}
